package br.com.intelsys.security.ldap;

import javax.naming.NamingException;
import javax.naming.directory.Attribute;
import javax.naming.directory.Attributes;

public class LdapObject {
	private final Attributes attrs;

	LdapObject(Attributes attrs) {
		this.attrs = attrs;
	}

	public String getAttr(String name) {
		Attribute attr = attrs.get(name);
		try {
			return attr != null ? (String) attr.get() : null;
		} catch (NamingException e) {
			return null;
		}
	}
}
